﻿namespace Web.Control.WWW.Files
{
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Text.RegularExpressions;
    using System.IO;
    using Lx.Web.Common.ControlsUI;
    using Lx.Web.Common.UI;
    using Model.WWW_WWW.files;
    using BLF.WWW_WWW.Files;
    using System.Collections.Generic;

    public class Commentlist : BaseControl
    {
       
        protected Repeater repLfil;
        protected Repeater repComm;
        protected List<FileDocModel> rfileList=null;
        protected List<DocCommentModel> docomList=null;
        protected FileDocModel DocModel=null;
        protected string docid="";
        protected int pageIndex = 1;
        /// <summary>
        /// 数据数量
        /// </summary>
        protected int RecordCount = 0;
        protected bool IsLike;
        protected List<string> TagList;
        protected override void OnLoad(EventArgs e)
        {
            rfileList = null;
            docomList = null;
            if (!string.IsNullOrEmpty(Request["did"]))
            {
                docid = Request["did"];
            }
            else
            {
                Response.End();
            }
            if(!string.IsNullOrEmpty(Request["p"]))
            {
            pageIndex =int.Parse( Request["p"]);
            }
            DocModel = Files.GetOneFile(new Guid(docid), pageIndex, 15, out RecordCount, out docomList, out rfileList, out IsLike, out TagList);
                this.DynamicTitle = GetText("AS506");
                this.DynamicKeywords = GetText("AS507");
                this.DynamicDescription = GetText("AS508");
            if (repLfil != null)
            {
                repLfil.DataSource = rfileList;
                repLfil.DataBind();
            }
            if (repComm != null)
            {
                repComm.DataSource = docomList;
                repComm.DataBind();
            }
       }
    }
}
